import java.util.*;


public class code1 {
    /**
     * 代码中的类名、方法名、参数名已经指定，请勿修改，直接返回方法规定的值即可
     *
     *
     * @param param string字符串 
     * @return string字符串
     */
    public String compressString (String param) {

        if(param.length() == 0) return "";
        char[] ss = param.toCharArray();
        int count = 1;
        StringBuilder ret = new StringBuilder();
        for(int i=1;i<ss.length;i++) {
            if(ss[i-1] == ss[i]) {
                count++;
            } else {
                ret.append(ss[i-1]);
                if(count != 1) {
                    ret.append(count);
                }
                count = 1;
            }
        }
        ret.append(ss[ss.length-1]);
        if(count != 1) ret.append(count);
        return ret.toString();
    }
}